package c.h.a.m0.s;

import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;

/* compiled from: AbsTorchControl */
public abstract class a implements b {
    public CameraManager a;
    public String b;
    public Boolean c = null;
    public Boolean d = null;

    public String c(CameraManager cameraManager) {
        try {
            for (String str : cameraManager.getCameraIdList()) {
                CameraCharacteristics cameraCharacteristics = cameraManager.getCameraCharacteristics(str);
                Boolean bool = (Boolean) cameraCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
                Integer num = (Integer) cameraCharacteristics.get(CameraCharacteristics.LENS_FACING);
                if (bool != null && bool.booleanValue() && num != null && num.intValue() == 1) {
                    return str;
                }
            }
        } catch (CameraAccessException unused) {
        }
        return null;
    }

    /* JADX WARNING: Removed duplicated region for block: B:10:0x001f  */
    public boolean d() {
        /*
        r2 = this;
        r0 = r2.b;
        r0 = android.text.TextUtils.isEmpty(r0);
        r1 = 0;
        if (r0 == 0) goto L_0x000a;
    L_0x0009:
        return r1;
    L_0x000a:
        r0 = r2.b;
        r0 = android.text.TextUtils.isEmpty(r0);
        if (r0 == 0) goto L_0x0013;
    L_0x0012:
        goto L_0x0017;
    L_0x0013:
        r0 = r2.c;
        if (r0 != 0) goto L_0x0019;
    L_0x0017:
        r0 = 0;
        goto L_0x001d;
    L_0x0019:
        r0 = r0.booleanValue();
    L_0x001d:
        if (r0 == 0) goto L_0x002b;
    L_0x001f:
        r0 = r2.d;
        if (r0 != 0) goto L_0x0024;
    L_0x0023:
        goto L_0x002b;
    L_0x0024:
        r0 = r0.booleanValue();
        if (r0 == 0) goto L_0x002b;
    L_0x002a:
        r1 = 1;
    L_0x002b:
        return r1;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.h.a.m0.s.a.d():boolean");
    }

    public void e(boolean z) {
        if (!Boolean.valueOf(z).equals(this.c)) {
            this.c = Boolean.valueOf(z);
        }
    }

    public void f(boolean z) {
        if (!Boolean.valueOf(z).equals(this.d)) {
            this.d = Boolean.valueOf(z);
        }
    }
}
